﻿using Uniforax.Camp.TestData.Common;
using Uniforax.Core.Common;
using Uniforax.Core.GameObjects;

namespace Uniforax.Camp.TestData.TheTech
{
    public class TheTech : BaseGameObject
    {
        public TheTech() : base()
        {
            Init();
        }

        public TheTech(TheTech other) : base(other)
        {
            Copy(other);
        }

        private void Init()
        {
            HP = 100;
            PowerRequired = 5;
            ArmorManager = new TestDataArmorManager();
        }

        private void Copy(TheTech other)
        {
            HP = other.HP;
            PowerRequired = other.PowerRequired;
            ArmorManager = other.ArmorManager.Clone() as TestDataArmorManager;
        }

        public override void OnPlacedGrid(ActionContext context, GameObjectPlaceGridMovementContext moveContext)
        {
            TestDataArmorManager.HandleOnPlaceUnlockUpgradeArmorAuto(context, this);
            base.OnPlacedGrid(context, moveContext);
        }

        public override object Clone()
        {
            return new TheTech(this);
        }
    }
}
